class A{
	int fun(int a,int b){
		int i;
		for(i=a>b?b:a;i>=1;i--)
			if(a%i==0&&b%i==0)
				break;
		return i;
	}
}
class B{
	A a=new A();
	int fun(int a,int b){
		return a*b/this.a.fun(a,b);
	}
}
public class zy10 {
  public static void main(String[] args){
	  A a=new A();
	  B b=new B();
	  System.out.println(a.fun(24, 36));
	  System.out.println(b.fun(24,36));
  }
}
